home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 03 - 1987 / 03.04 Apr 87 / MPW macros / doDLOG < prev    next >
Encoding:
Text File  |  1987-01-26  |  1.3 KB  |  68 lines  |  [TEXT/MPS ]

  1. #    This interactively builds a 'CNTL' rez definition
  2. #    Frank Alviani    -    Tuesday, December 9, 1986 9:40:06 AM
  3.  
  4. set exit 0        #so 'cancel' buttons not fatal
  5. echo "∂/* `request 'Purpose:'` *∂/"
  6. "{MPW}macros:getResAttrs" DLOG
  7.  
  8. set br "`request 'BoundsRect? (t,l,b,r)'`"
  9. set ty `request -d d 'Box: <D>oc|<B>ox|<P>lain|<A>lt|<N>ogro|<Z>oom|<R>nd'`
  10. confirm 'Visible?'
  11. if {status} == 0
  12.     set vis "visible"
  13. else
  14.     set vis "invisible"
  15. end
  16. confirm 'GoAway?'
  17. if {status} == 0
  18.     set go "goAway"
  19. else
  20.     set go "noGoAway"
  21. end
  22. set ref `request -d 0 'Reference Constant?'`
  23. set ttl "`request -d Untitled 'Title?'`"
  24.  
  25. #determine window type
  26. if {ty} =~ /[Dd]≈/
  27.     set wtyp "documentProc"
  28. else
  29.     if {ty} =~ /[Bb]≈/
  30.         set wtyp "dBoxProc"
  31.     else
  32.         if {ty} =~ /[Pp]≈/
  33.             set wtyp "plainDBox"
  34.         else
  35.             if {ty} =~ /[Aa]≈/
  36.                 set wtyp "altDBoxProc"
  37.             else
  38.                 if {ty} =~ /[Nn]≈/
  39.                     set wtyp "noGrowDocProc"
  40.                 else
  41.                     if {ty} =~ /[Zz]≈/
  42.                         set wtyp "zoomProc"
  43.                     else
  44.                         if {ty} =~ /[Rr]≈/
  45.                             set wtyp "rDocProc"
  46.                         else
  47.                             set wtyp "unKnown"
  48.                         end
  49.                     end
  50.                 end
  51.             end
  52.         end
  53.     end
  54. end
  55.  
  56. #fill out rez entry
  57. echo "  ∂{{br}∂},"
  58. echo "  {wtyp},"
  59. echo "  {vis},"
  60. echo "  {go},"
  61. echo "  {ref},∂t∂/* refcon *∂/"
  62. copy •:Δ/∂n/ "{scr}"    #get saved ID
  63. paste § "{active}"
  64. echo ",∂t∂/* DITL ID# *∂/"
  65. echo "  ∂"{ttl}∂""
  66. echo "∂};"
  67.  
  68.